package HW2_3.pages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class UserPage extends InternalPage {

	 	
		@FindBy (name="username")
		public WebElement usernameField;
		
		@FindBy (name="email")
		public WebElement emailField;
		
		@FindBy (name="password")
		public WebElement passwordField;
		
		@FindBy (name="password2")
		public WebElement password2Field;
		
		@FindBy (name="permission")
		public WebElement roleField;
	
	  	@FindBy (css="img[alt=\"Remove\"]")
	    public WebElement deleteButton;
		
	 	@FindBy (name = "submit")
	    public WebElement saveButton;
	 	
		@FindBy (linkText = "kalinka")
	 	//@FindBy (xpath="//tr[2]/td[2]/a")
		public WebElement newUserLink;
	    
	 	@FindBy (id = "form")
		public WebElement newUserForm;
	    

		public boolean IsOnManagerPage() {
			return newUserForm.isDisplayed();
		}
	    
		public boolean isNewUserOk() {
			return newUserLink.getText().equals("kalinka");
		}
	   }
